package com.simple.study.base.pojo;

import lombok.Data;

import javax.persistence.Transient;
import java.io.Serializable;

@Data
public class Base implements Serializable {


    private static final long serialVersionUID = 3012890032714148777L;
    @Transient
    protected Integer pageNum = 1;
    @Transient
    protected Integer pageSize = 20;
    @Transient
    protected Integer rows = 20;
    @Transient
    protected String orderSqlStr = "";
    
    @Transient
    protected Integer pageLimit = 20;
    @Transient
    protected Integer pageOffset = 0;
    
	public void setPageParam(Integer pageNum, Integer pageSize) {
		if (pageNum != null && pageSize != null) {
			this.pageLimit = pageSize;
			this.pageOffset = (pageNum - 1) * pageSize;
		}
	}
}
